﻿@model IEnumerable<CNav.Model.ProductModel>

@{
    ViewBag.Title = "Product";
}

<div>
    <table id="box-table-a">
        <tr>
            <th>Name</th>
            <th>Description</th>
            <th>Category</th>
            <th>SubCategory</th>
            <th>Action</th>
        </tr>

        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Description)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Category)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.SubCategory)
                </td>

                <td>
                    @Html.ActionLink("Edit", "Edit", new { id = item.ID }) |
                    @Html.ActionLink("Details", "Details", new { id = item.ID }) |
                    @Html.ActionLink("Delete", "Delete", new { id = item.ID })
                </td>
            </tr>
        }
    </table>
    
     <ol>
          <li class="liCentre">
                <input type="button" value="Create New" id="createNew" />
        </li>
    </ol>
</div>

<script type="text/javascript">
    $(document).ready(function () {

        var cc = new CaseCentre();
        cc.BindButton("#createNew", '@Url.Content("~/Product/Create")');
    });
</script>
